package com.everflourish.yeah100.entity.marking;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.List;

import com.everflourish.yeah100.entity.clazz.ClassManage;

/**
 * 考试的基础信息
 * 
 * @author pf
 * @date 2015-4-15
 */
public class ExaminationBase implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String id; // 考试的id
	private String name; // 考试名称
	private String subject; // 科目
	private String date; // 创建日期
	private String type; // 类型 A/B卷 、 N卷
	private String publishDate; // 发布时间
	private List<ClassManage> classes;
	private Long lastModifiedTime;
	private List<String> userIds;
	private List<Teacher> teacherUsers;
	private String lastExaminationId;
	
	public List<Teacher> getTeacherUsers() {
		return teacherUsers;
	}

	public void setTeacherUsers(List<Teacher> teacherUsers) {
		this.teacherUsers = teacherUsers;
	}

	public List<String> getUserIds() {
		return userIds;
	}

	public void setUserIds(List<String> userIds) {
		this.userIds = userIds;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getPublishDate() {
		return publishDate;
	}

	public void setPublishDate(String publishDate) {
		this.publishDate = publishDate;
	}

	public List<ClassManage> getClasses() {
		return classes;
	}

	public void setClasses(List<ClassManage> classes) {
		this.classes = classes;
	}

	public Long getLastModifiedTime() {
		return lastModifiedTime;
	}

	public void setLastModifiedTime(Long lastModifiedTime) {
		this.lastModifiedTime = lastModifiedTime;
	}

	public String getLastExaminationId() {
		return lastExaminationId;
	}

	public void setLastExaminationId(String lastExaminationId) {
		this.lastExaminationId = lastExaminationId;
	}

	public Object deepCopy() {
		ObjectInputStream ois;
		try {
			// 将该对象序列化成流,因为写在流里的是对象的一个拷贝，而原对象仍然存在于JVM里面。所以利用这个特性可以实现对象的深拷贝
			ByteArrayOutputStream bos = new ByteArrayOutputStream();
			ObjectOutputStream oos = new ObjectOutputStream(bos);
			oos.writeObject(this);
			// 将流序列化成对象
			ByteArrayInputStream bis = new ByteArrayInputStream(
					bos.toByteArray());
			ois = new ObjectInputStream(bis);
			return ois.readObject();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
}
